#include <iostream>
using namespace std;

class A{
    protected:
        int value_a;
    public:
        A(){}
        A(int a):value_a(a){}
        ~A(){}
};

class B:public A{
    protected:
        int value_b;
    public:
        B(){}
        B(int a, int b):A(a), value_b(b){}
        ~B(){}
};

class C:public A{
    protected:
        int value_c;
    public:
        C(){}
        C(int a, int c):A(a), value_c(c){}
        ~C(){}
};

class D:public B, public C{
    private:
        int value_d;
    public:
        D(){}
        D(int a, int b, int c, int d):B(a, b), C(a, c), value_d(d){}
        ~D(){}
        void show(){
            // D类中会有两个A类的成员 value_a
            // 直接访问会报错  value_a 有歧义
            // cout << value_a << endl;

            // 下面的写法可以明确访问哪一个value_a 不报错
            // 但是我们D类中只想有一个value_a
            cout << B::value_a << endl;
            cout << C::value_a << endl;

            cout << value_b << endl;
            cout << value_c << endl;
            cout << value_d << endl;
        }
};

int main(int argc, const char *argv[]){
    D d1(10, 20, 30, 40);
    d1.show();
    return 0;
}